<html>
  <head>
    <script>
	
	var currentUrl = null;

	function updateUrl(tabId, changeInfo, tab) {
	    currentUrl = tab.url;
    };
      
    chrome.tabs.onUpdated.addListener(updateUrl);

    </script>
  </head>
</html>